package collectiondemo;

//Java 实例 - 集合比较
public class Main {
    public static void main(String[] args) {
        String[] coins = {"Penny", "nickel", "dime", "Quarter", "dollar"};
        java.util.Set<String> set = new java.util.TreeSet<String>();
        java.util.Collections.addAll(set, coins);
        System.out.println(java.util.Collections.min(set));
        System.out.println(java.util.Collections.min(set, String.CASE_INSENSITIVE_ORDER));
        for (int i = 0; i <= 10; i++) {
            System.out.print("-");
        }
        System.out.println();
        System.out.println(java.util.Collections.max(set));
        System.out.println(java.util.Collections.max(set, String.CASE_INSENSITIVE_ORDER));
    }
}
